<?php

header("conent-type:text/html;charset=ytf-8");
require_once '..db_conn.php';
$conn;

$uesrname = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];
$time_at = time();

$sql = "
INSERT INTO  `bbs`.`t_message` (
`id` ,
`username` ,
`sex` ,
`content` ,
`avater` ,
`time_at`
)
VALUES (
NULL , '$username', 'sex', '$message', '$imgurl', '$time_at'
);
";

$result = $conn->quety($sql);
if($result===false){
    echo "数据写入错误！";
}else{
    header("Location: /bbs/index.php");
 
}